﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ReportViewer.aspx.cs" Inherits="SoftSource.Timecard.Web.ReportViewer" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Report Viewer</title>  
    <script language="javascript" type="text/javascript">
        function getWindowSize() {
            var w = 0;
            var h = 0;

            //IE
            if (!window.innerWidth) {
                //strict mode
                if (!(document.documentElement.clientWidth == 0)) {
                    w = document.documentElement.clientWidth;
                    h = document.documentElement.clientHeight;
                }
                //quirks mode
                else {
                    w = document.body.clientWidth;
                    h = document.body.clientHeight;
                }
            }
            //w3c
            else {
                w = window.innerWidth;
                h = window.innerHeight;
            }
            return { width: w, height: h };
        }
        function resizeReport() {
            var size = getWindowSize();
            var div = document.getElementById("fullFrame")
            var rpt = document.getElementById("ReportViewer1");
            var offset = rpt.rows[0].clientHeight+1;
            div.style.height = size.height - offset + "px"
            rpt.style.height = size.height - offset + "px"
        }

    </script>
    <style>
        html,body
        {
            height:100%;
            margin:0px;
            padding:0px;
        }
    </style>
</head>
    <body onload="resizeReport()" onresize="resizeReport()">
        <form id="form1" runat="server">  
        <asp:ScriptManager runat="server" ID="ScriptManager1" EnablePageMethods="true"></asp:ScriptManager> 
           <div id="fullFrame">
                <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Width="100%" Height="100%" Font-Size="8pt" />
            </div>
        </form>
    </body> 
</html>
